package com.fyzk.activity.prize.item;

import android.widget.LinearLayout;

import com.fyzk.activity.prize.InquiryInfo;
import com.fyzk.utils.LotteryIDUtils;

public class PrizeItemFactory {

    private static PrizeItemFactory instance;

    private PrizeItemFactory() {

    }

    public static PrizeItemFactory getInstance() {
        if (instance == null) {
            instance = new PrizeItemFactory();
        }
        return instance;
    }

    public PrizeItemBase getPrizeItem(InquiryInfo info, LinearLayout numLayout) {

        PrizeItemBase prizeItemBase = null;

        switch (info.lotteryType) {
            case LotteryIDUtils.DLT_LOTTERY_ID_INT:
                prizeItemBase = new DLTPrizeItem();
                prizeItemBase.setDate(info.drawTime);
                prizeItemBase.setPeroid(info.phase);
                prizeItemBase.setPrizeNum(info.wincode);
                prizeItemBase.initNumView(numLayout);
                break;
            case LotteryIDUtils.SSQ_LOTTERY_ID_INT:
                prizeItemBase = new SSQPrizeItem();
                prizeItemBase.setDate(info.drawTime);
                prizeItemBase.setPeroid(info.phase);
                prizeItemBase.setPrizeNum(info.wincode);
                prizeItemBase.initNumView(numLayout);
                break;
            case LotteryIDUtils.PL3_LOTTERY_ID_INT:
                prizeItemBase = new PL3PrizeItem();
                prizeItemBase.setDate(info.drawTime);
                prizeItemBase.setPeroid(info.phase);
                prizeItemBase.setPrizeNum(info.wincode);
                prizeItemBase.initNumView(numLayout);
                break;
            case LotteryIDUtils.PL5_LOTTERY_ID_INT:
                prizeItemBase = new PL5PrizeItem();
                prizeItemBase.setDate(info.drawTime);
                prizeItemBase.setPeroid(info.phase);
                prizeItemBase.setPrizeNum(info.wincode);
                prizeItemBase.initNumView(numLayout);
                break;
            case LotteryIDUtils.QXC_LOTTERY_ID_INT:
                prizeItemBase = new QXCPrizeItem();
                prizeItemBase.setDate(info.drawTime);
                prizeItemBase.setPeroid(info.phase);
                prizeItemBase.setPrizeNum(info.wincode);
                prizeItemBase.initNumView(numLayout);
                break;
            case LotteryIDUtils.QLC_LOTTERY_ID_INT:
                prizeItemBase = new QLCPrizeItem();
                prizeItemBase.setDate(info.drawTime);
                prizeItemBase.setPeroid(info.phase);
                prizeItemBase.setPrizeNum(info.wincode);
                prizeItemBase.initNumView(numLayout);
                break;
            case LotteryIDUtils.FC3D_LOTTERY_ID_INT:
                prizeItemBase = new FC3DPrizeItem();
                prizeItemBase.setDate(info.drawTime);
                prizeItemBase.setPeroid(info.phase);
                prizeItemBase.setPrizeNum(info.wincode);
                prizeItemBase.initNumView(numLayout);
                break;
            case LotteryIDUtils.SD11XUAN5_LOTTERY_ID_INT:
                prizeItemBase = new SD11X5PrizeItem();
                prizeItemBase.setDate(info.drawTime);
                prizeItemBase.setPeroid(info.phase);
                prizeItemBase.setPrizeNum(info.wincode);
                prizeItemBase.initNumView(numLayout);
                break;
            case LotteryIDUtils.KLSF_LOTTERY_ID_INT:
                prizeItemBase = new KLSFPrizeItem();
                prizeItemBase.setDate(info.drawTime);
                prizeItemBase.setPeroid(info.phase);
                prizeItemBase.setPrizeNum(info.wincode);
                prizeItemBase.initNumView(numLayout);
                break;
            case LotteryIDUtils.GDKLSF_LOTTERY_ID_INT:
                prizeItemBase = new GDKLSFPrizeItem();
                prizeItemBase.setDate(info.drawTime);
                prizeItemBase.setPeroid(info.phase);
                prizeItemBase.setPrizeNum(info.wincode);
                prizeItemBase.initNumView(numLayout);
                break;
            case LotteryIDUtils.GD11XUAN5_LOTTERY_ID_INT:
                prizeItemBase = new GD11X5PrizeItem();
                prizeItemBase.setDate(info.drawTime);
                prizeItemBase.setPeroid(info.phase);
                prizeItemBase.setPrizeNum(info.wincode);
                prizeItemBase.initNumView(numLayout);
                break;
            case LotteryIDUtils.XJ11XUAN5_LOTTERY_ID_INT:
                prizeItemBase = new XJ11X5PrizeItem();
                prizeItemBase.setDate(info.drawTime);
                prizeItemBase.setPeroid(info.phase);
                prizeItemBase.setPrizeNum(info.wincode);
                prizeItemBase.initNumView(numLayout);
                break;
            case LotteryIDUtils.CQSSC_LOTTERY_ID_INT:
                prizeItemBase = new SSCPrizeItem();
                prizeItemBase.setDate(info.drawTime);
                prizeItemBase.setPeroid(info.phase);
                prizeItemBase.setPrizeNum(info.wincode);
                prizeItemBase.initNumView(numLayout);
                break;
            case LotteryIDUtils.JZBF_LOTTERY_ID_INT:
            case LotteryIDUtils.JZRFSPF_LOTTERY_ID_INT:
            case LotteryIDUtils.JZSPF_LOTTERY_ID_INT:
                prizeItemBase = new JCZPrizeItem();
                prizeItemBase.setDate(info.drawTime);
                prizeItemBase.setPeroid(info.phase);
                prizeItemBase.setPrizeNum(info.wincode);
                prizeItemBase.initNumView(numLayout);
                break;
            case LotteryIDUtils.JLSF_LOTTERY_ID_INT:
                prizeItemBase = new JCLQPrizeItem();
                prizeItemBase.setDate(info.drawTime);
                prizeItemBase.setPeroid(info.phase);
                prizeItemBase.setPrizeNum(info.wincode);
                prizeItemBase.initNumView(numLayout);
                break;
            case LotteryIDUtils.ZCSFC_LOTTERY_ID_INT:
            case LotteryIDUtils.ZCRXJ_LOTTERY_ID_INT:
            case LotteryIDUtils.ZCBQC_LOTTERY_ID_INT:
            case LotteryIDUtils.ZCJQC_LOTTERY_ID_INT:
                prizeItemBase = new ZCPrizeItem();
                prizeItemBase.setDate(info.drawTime);
                prizeItemBase.setPeroid(info.phase);
                prizeItemBase.lotteryId = info.lotteryType;
                prizeItemBase.setPrizeNum(info.wincode);
                prizeItemBase.initNumView(numLayout);
                break;

            case LotteryIDUtils.ANHUIK3_LOTTERY_ID_INT:
                prizeItemBase = new AHK3PrizeItem();
                prizeItemBase.setDate(info.drawTime);
                prizeItemBase.setPeroid(info.phase);
                prizeItemBase.setPrizeNum(info.wincode);
                prizeItemBase.initNumView(numLayout);
                break;
            case LotteryIDUtils.JSK3_LOTTERY_ID_INT:
                prizeItemBase = new JSK3PrizeItem();
                prizeItemBase.setDate(info.drawTime);
                prizeItemBase.setPeroid(info.phase);
                prizeItemBase.setPrizeNum(info.wincode);
                prizeItemBase.initNumView(numLayout);
                break;
            case LotteryIDUtils.JLK3_LOTTERY_ID_INT:
                prizeItemBase = new JLK3PrizeItem();
                prizeItemBase.setDate(info.drawTime);
                prizeItemBase.setPeroid(info.phase);
                prizeItemBase.setPrizeNum(info.wincode);
                prizeItemBase.initNumView(numLayout);
                break;
            case LotteryIDUtils.GXK3_LOTTERY_ID_INT:
                prizeItemBase = new GXK3PrizeItem();
                prizeItemBase.setDate(info.drawTime);
                prizeItemBase.setPeroid(info.phase);
                prizeItemBase.setPrizeNum(info.wincode);
                prizeItemBase.initNumView(numLayout);
                break;
            case LotteryIDUtils.KLPK_LOTTERY_ID_INT:
                prizeItemBase = new KLPKPrizeItem();
                prizeItemBase.setDate(info.drawTime);
                prizeItemBase.setPeroid(info.phase);
                prizeItemBase.setPrizeNum(info.wincode);
                prizeItemBase.initNumView(numLayout);
                break;
            case LotteryIDUtils.DCSPF_LOTTERY_ID_INT:
                prizeItemBase = new BeiDanPrizeItem();
                prizeItemBase.setDate(info.drawTime);
                prizeItemBase.setPeroid(info.phase);
                prizeItemBase.setPrizeNum(info.wincode);
                break;
        }
        return prizeItemBase;
    }

    public PrizeItemBase getPrizeItem(InquiryInfo info) {

        PrizeItemBase prizeItemBase = null;

        switch (info.lotteryType) {
            case LotteryIDUtils.DLT_LOTTERY_ID_INT:
                prizeItemBase = new DLTPrizeItem();
                prizeItemBase.setDate(info.drawTime);
                prizeItemBase.setPeroid(info.phase);
                prizeItemBase.setPrizeNum(info.wincode);
                break;
            case LotteryIDUtils.SSQ_LOTTERY_ID_INT:
                prizeItemBase = new SSQPrizeItem();
                prizeItemBase.setDate(info.drawTime);
                prizeItemBase.setPeroid(info.phase);
                prizeItemBase.setPrizeNum(info.wincode);
                break;
            case LotteryIDUtils.PL3_LOTTERY_ID_INT:
                prizeItemBase = new PL3PrizeItem();
                prizeItemBase.setDate(info.drawTime);
                prizeItemBase.setPeroid(info.phase);
                prizeItemBase.setPrizeNum(info.wincode);
                break;
            case LotteryIDUtils.QLC_LOTTERY_ID_INT:
                prizeItemBase = new QLCPrizeItem();
                prizeItemBase.setDate(info.drawTime);
                prizeItemBase.setPeroid(info.phase);
                prizeItemBase.setPrizeNum(info.wincode);
                break;
            case LotteryIDUtils.PL5_LOTTERY_ID_INT:
                prizeItemBase = new PL5PrizeItem();
                prizeItemBase.setDate(info.drawTime);
                prizeItemBase.setPeroid(info.phase);
                prizeItemBase.setPrizeNum(info.wincode);
                break;
            case LotteryIDUtils.QXC_LOTTERY_ID_INT:
                prizeItemBase = new QXCPrizeItem();
                prizeItemBase.setDate(info.drawTime);
                prizeItemBase.setPeroid(info.phase);
                prizeItemBase.setPrizeNum(info.wincode);
                break;
            case LotteryIDUtils.FC3D_LOTTERY_ID_INT:
                prizeItemBase = new FC3DPrizeItem();
                prizeItemBase.setDate(info.drawTime);
                prizeItemBase.setPeroid(info.phase);
                prizeItemBase.setPrizeNum(info.wincode);
                break;
            case LotteryIDUtils.KLSF_LOTTERY_ID_INT:
                prizeItemBase = new KLSFPrizeItem();
                prizeItemBase.setDate(info.drawTime);
                prizeItemBase.setPeroid(info.phase);
                prizeItemBase.setPrizeNum(info.wincode);
                break;
            case LotteryIDUtils.GDKLSF_LOTTERY_ID_INT:
                prizeItemBase = new GDKLSFPrizeItem();
                prizeItemBase.setDate(info.drawTime);
                prizeItemBase.setPeroid(info.phase);
                prizeItemBase.setPrizeNum(info.wincode);
                break;
            case LotteryIDUtils.CQSSC_LOTTERY_ID_INT:
                prizeItemBase = new SSCPrizeItem();
                prizeItemBase.setDate(info.drawTime);
                prizeItemBase.setPeroid(info.phase);
                prizeItemBase.setPrizeNum(info.wincode);
                break;
            case LotteryIDUtils.SD11XUAN5_LOTTERY_ID_INT:
                prizeItemBase = new SD11X5PrizeItem();
                prizeItemBase.setDate(info.drawTime);
                prizeItemBase.setPeroid(info.phase);
                prizeItemBase.setPrizeNum(info.wincode);
                break;
            case LotteryIDUtils.GD11XUAN5_LOTTERY_ID_INT:
                prizeItemBase = new GD11X5PrizeItem();
                prizeItemBase.setDate(info.drawTime);
                prizeItemBase.setPeroid(info.phase);
                prizeItemBase.setPrizeNum(info.wincode);
                break;
            case LotteryIDUtils.XJ11XUAN5_LOTTERY_ID_INT:
                prizeItemBase = new XJ11X5PrizeItem();
                prizeItemBase.setDate(info.drawTime);
                prizeItemBase.setPeroid(info.phase);
                prizeItemBase.setPrizeNum(info.wincode);
                break;
            case LotteryIDUtils.JZBF_LOTTERY_ID_INT:
            case LotteryIDUtils.JZRFSPF_LOTTERY_ID_INT:
            case LotteryIDUtils.JZSPF_LOTTERY_ID_INT:
                prizeItemBase = new JCZPrizeItem();
                prizeItemBase.setDate(info.drawTime);
                prizeItemBase.setPeroid(info.phase);
                prizeItemBase.setPrizeNum(info.wincode);
                break;
            case LotteryIDUtils.ZCSFC_LOTTERY_ID_INT:
            case LotteryIDUtils.ZCRXJ_LOTTERY_ID_INT:
            case LotteryIDUtils.ZCBQC_LOTTERY_ID_INT:
            case LotteryIDUtils.ZCJQC_LOTTERY_ID_INT:
                prizeItemBase = new ZCPrizeItem();
                prizeItemBase.setDate(info.drawTime);
                prizeItemBase.setPeroid(info.phase);
                prizeItemBase.lotteryId = info.lotteryType;
                prizeItemBase.setPrizeNum(info.wincode);
                break;
            case LotteryIDUtils.JLSF_LOTTERY_ID_INT:
                prizeItemBase = new JCLQPrizeItem();
                prizeItemBase.setDate(info.drawTime);
                prizeItemBase.setPeroid(info.phase);
                prizeItemBase.setPrizeNum(info.wincode);
                break;
            case LotteryIDUtils.ANHUIK3_LOTTERY_ID_INT:
                prizeItemBase = new AHK3PrizeItem();
                prizeItemBase.setDate(info.drawTime);
                prizeItemBase.setPeroid(info.phase);
                prizeItemBase.setPrizeNum(info.wincode);
                break;
            case LotteryIDUtils.JSK3_LOTTERY_ID_INT:
                prizeItemBase = new JSK3PrizeItem();
                prizeItemBase.setDate(info.drawTime);
                prizeItemBase.setPeroid(info.phase);
                prizeItemBase.setPrizeNum(info.wincode);
                break;
            case LotteryIDUtils.JLK3_LOTTERY_ID_INT:
                prizeItemBase = new JLK3PrizeItem();
                prizeItemBase.setDate(info.drawTime);
                prizeItemBase.setPeroid(info.phase);
                prizeItemBase.setPrizeNum(info.wincode);
                break;
            case LotteryIDUtils.GXK3_LOTTERY_ID_INT:
                prizeItemBase = new GXK3PrizeItem();
                prizeItemBase.setDate(info.drawTime);
                prizeItemBase.setPeroid(info.phase);
                prizeItemBase.setPrizeNum(info.wincode);
                break;
            case LotteryIDUtils.KLPK_LOTTERY_ID_INT:
                prizeItemBase = new KLPKPrizeItem();
                prizeItemBase.setDate(info.drawTime);
                prizeItemBase.setPeroid(info.phase);
                prizeItemBase.setPrizeNum(info.wincode);
                break;
            case LotteryIDUtils.DCSPF_LOTTERY_ID_INT:
                prizeItemBase = new BeiDanPrizeItem();
                prizeItemBase.setDate(info.drawTime);
                prizeItemBase.setPeroid(info.phase);
                prizeItemBase.setPrizeNum(info.wincode);
                break;
        }
        return prizeItemBase;
    }

}
